<!DOCTYPE html>
<html lang="en">
<head>
<title>WebView4Delphi: uWVTypeLibrary: Interface ICoreWebView2_16</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICoreWebView2_16"></span><h1 class="cio">Interface ICoreWebView2_16</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uWVTypeLibrary.html">uWVTypeLibrary</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICoreWebView2_16 = interface(<a class="normal" href="uWVTypeLibrary.ICoreWebView2_15.html">ICoreWebView2_15</a>)</code></p>
<h2 class="description">Description</h2>
<p>
 A continuation of the ICoreWebView2 interface to support printing. </p>
<p>


<p>&lt;see href=&quot;<a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_16">https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_16</a>&quot;&gt;See the ICoreWebView2_16 article.)</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IUnknown</li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2.html">ICoreWebView2</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_2.html">ICoreWebView2_2</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_3.html">ICoreWebView2_3</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_4.html">ICoreWebView2_4</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_5.html">ICoreWebView2_5</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_6.html">ICoreWebView2_6</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_7.html">ICoreWebView2_7</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_8.html">ICoreWebView2_8</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_9.html">ICoreWebView2_9</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_10.html">ICoreWebView2_10</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_11.html">ICoreWebView2_11</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_12.html">ICoreWebView2_12</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_13.html">ICoreWebView2_13</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_14.html">ICoreWebView2_14</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_15.html">ICoreWebView2_15</a></li>
<li class="thisitem">ICoreWebView2_16</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2_16.html#Print-ICoreWebView2PrintSettings-ICoreWebView2PrintCompletedHandler-">Print</a></strong>(const printSettings: <a href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a>; const handler: <a href="uWVTypeLibrary.ICoreWebView2PrintCompletedHandler.html">ICoreWebView2PrintCompletedHandler</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2_16.html#ShowPrintUI-COREWEBVIEW2_PRINT_DIALOG_KIND-">ShowPrintUI</a></strong>(printDialogKind: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DIALOG_KIND">COREWEBVIEW2_PRINT_DIALOG_KIND</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2_16.html#PrintToPdfStream-ICoreWebView2PrintSettings-ICoreWebView2PrintToPdfStreamCompletedHandler-">PrintToPdfStream</a></strong>(const printSettings: <a href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a>; const handler: <a href="uWVTypeLibrary.ICoreWebView2PrintToPdfStreamCompletedHandler.html">ICoreWebView2PrintToPdfStreamCompletedHandler</a>): HResult; stdcall;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Print-ICoreWebView2PrintSettings-ICoreWebView2PrintCompletedHandler-"></span><code>function <strong>Print</strong>(const printSettings: <a href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a>; const handler: <a href="uWVTypeLibrary.ICoreWebView2PrintCompletedHandler.html">ICoreWebView2PrintCompletedHandler</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Print the current web page asynchronously to the specified printer with the provided settings. See `ICoreWebView2PrintSettings` for description of settings. Passing nullptr for `printSettings` results in default print settings used.

<p>The handler will return `errorCode` as `S_OK` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE if `printerName` doesn't match with the name of any installed printers on the user OS. The handler will return `errorCode` as `E_INVALIDARG` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR if the caller provides invalid settings for a given printer.

<p>The async `Print` operation completes when it finishes printing to the printer. At this time the `ICoreWebView2PrintCompletedHandler` is invoked. Only one `Printing` operation can be in progress at a time. If `Print` is called while a `Print` or `PrintToPdf` or `PrintToPdfStream` or `ShowPrintUI` job is in progress, the completed handler is immediately invoked with `E_ABORT` and `printStatus` is COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR. This is only for printing operation on one webview.

<p>| errorCode | printStatus | Notes | | &mdash; | &mdash; | &mdash; | | S_OK | COREWEBVIEW2_PRINT_STATUS_SUCCEEDED | Print operation succeeded. | | S_OK | COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE | If specified printer is not found or printer status is not available, offline or error state. | | S_OK | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR | Print operation is failed. | | E_INVALIDARG | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR | If the caller provides invalid settings for the specified printer. | | E_ABORT | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR | Print operation is failed as printing job already in progress. |

<p>\snippet AppWindow.cpp PrintToPrinter </p>
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
  <dt>GUID['{0EB34DC9-9F91-41E1-8639-95CD5943906B}']</dt>
  <dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="ShowPrintUI-COREWEBVIEW2_PRINT_DIALOG_KIND-"></span><code>function <strong>ShowPrintUI</strong>(printDialogKind: <a href="uWVTypeLibrary.html#COREWEBVIEW2_PRINT_DIALOG_KIND">COREWEBVIEW2_PRINT_DIALOG_KIND</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Opens the print dialog to print the current web page. See `COREWEBVIEW2_PRINT_DIALOG_KIND` for descriptions of print dialog kinds.

<p>Invoking browser or system print dialog doesn't open new print dialog if it is already open.

<p>\snippet AppWindow.cpp ShowPrintUI </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="PrintToPdfStream-ICoreWebView2PrintSettings-ICoreWebView2PrintToPdfStreamCompletedHandler-"></span><code>function <strong>PrintToPdfStream</strong>(const printSettings: <a href="uWVTypeLibrary.ICoreWebView2PrintSettings.html">ICoreWebView2PrintSettings</a>; const handler: <a href="uWVTypeLibrary.ICoreWebView2PrintToPdfStreamCompletedHandler.html">ICoreWebView2PrintToPdfStreamCompletedHandler</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Provides the Pdf data of current web page asynchronously for the provided settings. Stream will be rewound to the start of the pdf data.

<p>See `ICoreWebView2PrintSettings` for description of settings. Passing nullptr for `printSettings` results in default print settings used.

<p>The async `PrintToPdfStream` operation completes when it finishes writing to the stream. At this time the `ICoreWebView2PrintToPdfStreamCompletedHandler` is invoked. Only one `Printing` operation can be in progress at a time. If `PrintToPdfStream` is called while a `PrintToPdfStream` or `PrintToPdf` or `Print` or `ShowPrintUI` job is in progress, the completed handler is immediately invoked with `E_ABORT`. This is only for printing operation on one webview.

<p>\snippet AppWindow.cpp PrintToPdfStream </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>
